package
{
	
	import Manager;
	import Map;
	
	public class MapManager extends Manager
	{
		
		private var _maps:Array;
		
		public function MapManager()
		{
			
			super();
			this._maps = [];
			
		}
		
		public function set mapList(list:Array):void
		{
			
			this._maps = list;
			
		}
		
		public static function getMapByID(mapID:int):Map
		{
			
			var i:int = 0;
			var n:Number = this.mapList.length;
			var m:Map = null;
			
				if (n > 0 && mapID > 0)
				{
					
					while (i < n)
					{
						
						m = this.mapList[i] as Map;
						
						if (m.mapBase.intMapID == mapID)
						{
							
							return m;
							i++;
							
						}
					}
				}
				
				return null;
				
		}
		
		public static function getMap(map:Map):Map
		{
			
			return this.getMapByID(map.mapBase.mapID);
			
		}
	}
}